// var top = 'http://122.112.161.135:3000/top/playlist'
// var banner = "http://122.112.161.135:3000/banner"
// var dj = "http://122.112.161.135:3000/program/recommend"
// 导入jsonp模块
import { jsonp } from 'vue-jsonp'
/* 封装定位城市 */
function http({ url }) {
    return new Promise((resolve, reject) => {
        jsonp(url).then(res => {
            if (res.status == 0) {
                resolve(res.result)
            } else {
                resolve(res.data.list)
            }
        })
    })
}
const getPlaylistHttp = () => {
    return http({
        url: "top/playlist"
    })
}
/* 获取定位城市的信息 */
const locationCity = () => {
    return http({
        url: 'https://apis.map.qq.com/ws/location/v1/ip?key=5C7BZ-EDALU-4ACVA-2T36I-DJM56-Z4FJ5&output=jsonp'
    })
}
/* 获取存储城市的代码信息 */
const historyCity = (city) => {
    return http({
        url: `https://apis.map.qq.com/ws/geocoder/v1/?address=${city}&key=5C7BZ-EDALU-4ACVA-2T36I-DJM56-Z4FJ5&output=jsonp`
    })
}
/* 获取存储城市的代码信息 */
const getDisease = () => {
    return http({
        url: "https://interface.sina.cn/news/wap/fymap2020_data.d.json?_=1580892522427",
    })
}
export { historyCity, locationCity, getDisease }